package ltd.smallwang.experiment;

import ltd.smallwang.ApplicationTest;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest(classes = ApplicationTest.class)
class RedissonTest {

  @Autowired
  private RedissonClient redissonClient;

  @Test
  void testRedisson() {
    redissonClient.getBucket("region_0001").set("nanjing");
    String region = (String) redissonClient.getBucket("region_0001").get();
    Assertions.assertThat(region).isEqualTo("nanjing");
  }
}
